﻿using System.Collections.Generic;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers
{
    public class FxSerieComparer : IEqualityComparer<FxSerie>
    {
        public bool Equals(FxSerie x, FxSerie y)
        {
            return x.Date == y.Date && x.CurrencyId == y.CurrencyId;
        }

        public int GetHashCode(FxSerie obj)
        {
            return (obj.Date.ToShortDateString() + obj.CurrencyId).GetHashCode();
        }
    }
}